﻿<local:SectionWidget x:Class="WpfApp1.Views.OrderHistoryWorkersSectionWidget"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:WpfApp1.Views"
             mc:Ignorable="d" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
    <Grid Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="88*"></RowDefinition>
            <RowDefinition Height="auto"></RowDefinition>
        </Grid.RowDefinitions>
        <DataGrid x:Name="dataGrid" Grid.Row="0" AutoGenerateColumns="False" IsReadOnly="True" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="Id" Binding="{Binding Path=WorkerId}" Width="40" />
                <DataGridTextColumn Header="Фамилия" Binding="{Binding Path=WorkerLastname}" Width="90" />
                <DataGridTextColumn Header="Имя" Binding="{Binding Path=WorkerFirstname}" Width="90" />
                <DataGridTextColumn Header="Отчество" Binding="{Binding Path=WorkerPatronymic}" Width="90" />
                <DataGridTextColumn Header="Должность" Binding="{Binding Path=WorkerPost}" Width="120" />
            </DataGrid.Columns>
        </DataGrid>
        <DockPanel Grid.Row="1" Margin="10" Height="32">
            <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" FlowDirection="LeftToRight">
                <Button x:Name="btnClose" Width="90" Margin="10 0" Template="{StaticResource commonButton}" Visibility="Collapsed" />
                <Button x:Name="btnPDF" Width="90" Margin="10 0" Template="{StaticResource commonButton}" Visibility="Collapsed" />
                <Button x:Name="btnInsert" Width="90" Margin="10 0" Template="{StaticResource commonButton}" Command="{Binding InsertCommand}">Вставить</Button>
                <Button x:Name="btnUpdate" Width="90" Margin="10 0" Template="{StaticResource commonButton}" Visibility="Collapsed">Изменить</Button>
                <Button x:Name="btnDelete" Width="90" Margin="10 0" Template="{StaticResource commonButton}" Command="{Binding DeleteCommand}">Удалить</Button>
                <Button x:Name="btnRead"  Width="90" Margin="10 0" Template="{StaticResource commonButton}" Command="{Binding ReadCommand}">Просмотр</Button>
            </StackPanel>
        </DockPanel>

    </Grid>
</local:SectionWidget >
